<?php
/**
 *Title:
 *<br/>By: 王龙 2022/8/29 17:56
 */

namespace api\portal\controller;

use api\portal\model\PortalPostModel;
use cmf\controller\RestBaseController;
use api\portal\model\PortalTagModel;
use think\facade\Env;

class QrcodeController extends RestBaseController
{

    public function getqrcode(){



        require  Env::get("root_path").'vendor/phpqrcode/qrlib.php';

        $user=1;

        $imgfile="/upload/ptqrcode/".md5($user).".jpg";
        $filename = CMF_ROOT. "public".$imgfile;//要生成的图片名字


        \QRcode::png('abc',$filename,QR_ECLEVEL_L,10,0,true);

        $this->success('普通二维码',cmf_get_image_url($imgfile));

    }



}